Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql,colexec: minor cleanup of scan-related things #57267

Merged
merged 1 commit into from
Dec 1, 2020

Conversation

yuzefovich
Copy link
Member

This commit removes multiple arguments in favor of using the spec when
initializing the cFetcher as well as refactors several loops in order to
avoid making copies of descriptors during table reader planning.

Additionally, it moves a map from scanNode next to the map's only user
(stats job) and removes the map from the scanNode itself as well as
removes some of the unused arguments.

Release note: None

@yuzefovich yuzefovich requested review from jordanlewis and a team December 1, 2020 00:28
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@@ -1013,8 +1013,8 @@ func tableOrdinal(
}
if visibility == execinfra.ScanVisibilityPublicAndNotPublic {
offset := len(desc.Columns)
for i, col := range desc.MutationColumns() {
if col.ID == colID {
for i := range desc.MutationColumns() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extract desc.MutationColumns() outside of the loop, I don't think the compiler can necessarily eliminate the common subexpression here.

for _, col := range info.desc.MutationColumns() {
typs = append(typs, col.Type)
for i := range info.desc.MutationColumns() {
typs = append(typs, info.desc.MutationColumns()[i].Type)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto above

for _, c := range info.desc.MutationColumns() {
descColumnIDs.Set(colID, int(c.ID))
for i := range info.desc.MutationColumns() {
descColumnIDs.Set(colID, int(info.desc.MutationColumns()[i].ID))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto above

This commit removes multiple arguments in favor of using the spec when
initializing the cFetcher as well as refactors several loops in order to
avoid making copies of descriptors during table reader planning.

Additionally, it moves a map from scanNode next to the map's only user
(stats job) and removes the map from the scanNode itself as well as
removes some of the unused arguments.

Release note: None
Copy link
Member Author

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TFTR!

bors r+

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @jordanlewis)


pkg/sql/distsql_physical_planner.go, line 1016 at r1 (raw file):

Previously, jordanlewis (Jordan Lewis) wrote…

extract desc.MutationColumns() outside of the loop, I don't think the compiler can necessarily eliminate the common subexpression here.

Done.


pkg/sql/distsql_physical_planner.go, line 1288 at r1 (raw file):

Previously, jordanlewis (Jordan Lewis) wrote…

ditto above

Done.


pkg/sql/distsql_physical_planner.go, line 1311 at r1 (raw file):

Previously, jordanlewis (Jordan Lewis) wrote…

ditto above

Done.

craig bot pushed a commit that referenced this pull request Dec 1, 2020
57267: sql,colexec: minor cleanup of scan-related things r=yuzefovich a=yuzefovich

This commit removes multiple arguments in favor of using the spec when
initializing the cFetcher as well as refactors several loops in order to
avoid making copies of descriptors during table reader planning.

Additionally, it moves a map from scanNode next to the map's only user
(stats job) and removes the map from the scanNode itself as well as
removes some of the unused arguments.

Release note: None

Co-authored-by: Yahor Yuzefovich <[email protected]>
@craig
Copy link
Contributor

craig bot commented Dec 1, 2020

Build failed:

@yuzefovich
Copy link
Member Author

Mysterious test failure with what-looks-like empty logs.

bors r+

@craig
Copy link
Contributor

craig bot commented Dec 1, 2020

Build succeeded:

@craig craig bot merged commit 6980223 into cockroachdb:master Dec 1, 2020
@yuzefovich yuzefovich deleted the cleanup branch December 1, 2020 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants